

package jetbrains.buildServer.server.rest.model;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import jetbrains.buildServer.server.rest.util.BeanContext;
import jetbrains.buildServer.server.rest.util.ValueWithDefault;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Yegor.Yarko
 * Date: 20/04/2019
 */
@XmlRootElement(name = "unknown")
public class UnknownEntity {
  @XmlAttribute(name = "internalId")
  private String internalId;

  @XmlAttribute(name = "type")
  private String type;

  @SuppressWarnings("unused")
  public UnknownEntity() {
  }

  public UnknownEntity(@Nullable final String internalId, @Nullable final String type, @NotNull Fields fields, @NotNull final BeanContext beanContext) {
    this.internalId = ValueWithDefault.decideIncludeByDefault(fields.isIncluded("internalId"), internalId);
    this.type = ValueWithDefault.decideIncludeByDefault(fields.isIncluded("type"), type);
  }
}